﻿using Newtonsoft.Json;
using W.Common;

namespace W.Carrier.Read.Api.Server
{
    public class httpshow
    {
        public async Task<dynamic> caeatepost()
        {
            string token = "";
            HttpClientWrapper client=new HttpClientWrapper(token);
            string url = "http://47.96.109.219:5249/api/User/offCreate";
            var data = new
            {
                offic_name = "上海空易网络科技有限公司",
                login_name = "16631057525",
                password = "qwe123456",
                no = "10010011",
                name = "任奥博",
                email = "2579183529@qq.com",
                phone = "16631057525",
                user_type = 8,
                sex = 1,
                mgr_type = 0,
                avatar = "/",
                end_date = "2024-12-16T03:44:22.565Z",
                useable = 0
            };
            var jsonContent=JsonConvert.SerializeObject(data);
            string postResponse=await client.PostAsync(url, jsonContent);
            return postResponse;
        }
        /// <summary>
        /// 承运商显示
        /// </summary>
        /// <returns></returns>
        public async Task<dynamic> GetCarrierShow()
        {
            string token = "";
            HttpClientWrapper client = new HttpClientWrapper(token);
            string url = "http://localhost:5268/api/Carrier/GetAllCarrier?PageIndex=1&PageSize=2";
            string list = await client.GetAsync(url);
            return list;
        }
        /// <summary>
        /// 承运商反填
        /// </summary>
        /// <returns></returns>
        public async Task<dynamic> GetCarrierModel()
        {
            string token = "";
            HttpClientWrapper client = new HttpClientWrapper(token);
            string url = "http://localhost:5268/api/Carrier/GetModelCarrier?CarrierId=6";
            string list = await client.GetAsync(url);
            return list;
        }

    }
}
